using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using InputSystem;

public class Move : CharacterState
{
    public Move(MainCharacter characterFSM) : base(characterFSM)
    {
        InputManager.Instance.UpdateInputEvent(MoveCheck, true);
    }

    public override void Enter()
    {
        Debug.Log("move");
    }

    private void MoveCheck(Vector2 vector2)
    {
        _characterFSM._RB2D.velocity = vector2 * _characterFSM._speed;
        if (vector2.magnitude == 0)
        {
            _characterFSM.Switch(_characterFSM._idle);
        }
    }
}

